package com.wisnews.config.shiro;

import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description：redis shiro 缓存管理器
 * @Author: yuyd
 * @Email: yyd8358@foxmail.com
 * @Date: 2020/12/19 9:23
 * @Version 1.0
 */
public class RedisCacheManager implements CacheManager {

    @Autowired
    RedisCache redisCache;

    @Override
    public <K, V> Cache<K, V> getCache(String s) throws CacheException {
        this.redisCache.setCacheName(s);
        return redisCache;
    }

}
